home *** CD-ROM | disk | FTP | other *** search
/ Giga Games 1 / Giga Games.iso / net / usenet / volume2 / dating < prev    next >
Encoding:
Internet Message Format  |  1987-10-26  |  50.2 KB

  1. Path: uunet!tektronix!tekgen!tekred!games-request
  2. From: games-request@tekred.TEK.COM
  3. Newsgroups: comp.sources.games
  4. Subject: v02i063:  dating - computerized dating data base
  5. Message-ID: <1746@tekred.TEK.COM>
  6. Date: 26 Oct 87 19:41:23 GMT
  7. Sender: billr@tekred.TEK.COM
  8. Lines: 2422
  9. Approved: billr@tekred.TEK.COM
  10.  
  11. Submitted by: Thomas M Johnson <john1233%csd4.milw.wisc.edu@csd1.milw.wisc.edu>
  12. Comp.sources.games: Volume 2, Issue 63
  13. Archive-name: dating
  14.  
  15.  
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then unpack
  19. # it by saving it into a file and typing "sh file".  To overwrite existing
  20. # files, type "sh file -c".  You can also feed this as standard input via
  21. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  22. # will see the following message at the end:
  23. #        "End of shell archive."
  24. # Contents:  Makefile Questions README bbase date.doc.v1 date.doc.v2
  25. #   date.v1.p date.v2.p getw.c getw.h
  26. # Wrapped by billr@tekred on Mon Oct 26 11:38:38 1987
  27. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  28. if test -f Makefile -a "${1}" != "-c" ; then 
  29.   echo shar: Will not over-write existing file \"Makefile\"
  30. else
  31. echo shar: Extracting \"Makefile\" \(336 characters\)
  32. sed "s/^X//" >Makefile <<'END_OF_Makefile'
  33. X# crude makefile for datingame (none supplied with original source)
  34. X#
  35. Xv1:    date.v1.p
  36. X    pc date.v1.p
  37. X    mv a.out datingame
  38. X    touch v1
  39. X
  40. Xinstall-v1:    v1
  41. X    touch database
  42. X
  43. Xv2:    getw.o date.v1.p
  44. X    pc date.v2.p getw.o
  45. X    mv a.out datingame
  46. X    touch v2
  47. X
  48. Xinstall-v2: v2
  49. X    mkdir .date
  50. X    cp Questions .date/Questions
  51. X    cp bbase .date/bbase
  52. X    touch .date/database
  53. END_OF_Makefile
  54. if test 336 -ne `wc -c <Makefile`; then
  55.     echo shar: \"Makefile\" unpacked with wrong size!
  56. fi
  57. # end of overwriting check
  58. fi
  59. if test -f Questions -a "${1}" != "-c" ; then 
  60.   echo shar: Will not over-write existing file \"Questions\"
  61. else
  62. echo shar: Extracting \"Questions\" \(6299 characters\)
  63. sed "s/^X//" >Questions <<'END_OF_Questions'
  64. X
  65. XWhat is your weight?
  66. X  A. Under 100 lbs.
  67. X  B. 100 lbs-125 lbs.
  68. X  C. 125 lbs-140 lbs.
  69. X  D. 140 lbs-160 lbs.
  70. X  E. 160 lbs-180 lbs.
  71. X  F. 180 lbs-200 lbs.
  72. X  G. 200 lbs-220 lbs.
  73. X  H. Over 220 lbs.
  74. X
  75. Xh
  76. XWhat is your height?
  77. X  A. Under 5 ft.
  78. X  B. 5 ft-5 ft. 4 in.
  79. X  C. 5 ft. 4 in. - 5 ft. 7 in.
  80. X  D. 5 ft. 7 in. - 5 ft. 10 in.
  81. X  E. 5 ft. 10 in. - 6 ft.
  82. X  F. Over 6 ft.
  83. X
  84. Xf
  85. XWhat is the color of your hair?
  86. X  A. Brown
  87. X  B. Black
  88. X  C. Red
  89. X  D. Blond
  90. X  E. Gray
  91. X  F. Auburn
  92. X  G. Bald
  93. X
  94. Xg
  95. XWhat is the color of your eyes?
  96. X  A. Brown
  97. X  B. Blue
  98. X  C. Hazel
  99. X  D. Green
  100. X  E. Violet
  101. X  F. Gray
  102. X
  103. Xf
  104. XHow old are you?
  105. X  A. Less than 18
  106. X  B. 18-20
  107. X  C. 21-23
  108. X  D. 24-27
  109. X  E. 28-32
  110. X  F. 33-40
  111. X  G. 41-50
  112. X  H. Over 50
  113. X
  114. Xh
  115. XHow do you dress?
  116. X  A. Preppie
  117. X  B. Casual
  118. X  C. Jeans and T-shirt
  119. X  D. Sleezy
  120. X  E. Dressy
  121. X  F. Conservatively
  122. X
  123. Xf
  124. XWhat is your ethnic group?
  125. X  A. White
  126. X  B. Black
  127. X  C. Hispanic
  128. X  D. Oriental/Asian
  129. X  E. Indian
  130. X
  131. Xe
  132. XWhat is your status?
  133. X  A. Single
  134. X  B. Separated/Divorced
  135. X  C. Widow/Widower
  136. X  D. Married
  137. X
  138. Xd
  139. XHow do you rate yourself on a
  140. Xscale from 1 to 10?
  141. X  A. Under 5
  142. X  B. 5 to 6
  143. X  C. 7 to 8
  144. X  D. 9 to 10
  145. X  E. Over 10
  146. X
  147. Xe
  148. XGiven the following choices
  149. XWhat is your favorite hobby?
  150. X  A. Sports                       K. Camping
  151. X  B. Dancing                      L. Computers / Electronics
  152. X  C. Concerts                     M. Politics
  153. X  D. Travel                       N. Listening to music
  154. X  E. Theater                      O. Photography
  155. X  F. Reading                      P. Arts and Crafts
  156. X  G. Domestics                    Q. Cooking
  157. X  H. Sex                          R. Dancing
  158. X  I. Watching television          S. Cars / Mechanics
  159. X  J. Shopping                     T. Work / Career
  160. X
  161. Xt
  162. XWhat is your favorite kind of music?
  163. X  A. Rock                         K. Opera
  164. X  B. Pop                          L. Folk
  165. X  C. New Wave                     M. Country and Western
  166. X  D. Punk                         N. Gospel
  167. X  E. Soul                         O. Electronic
  168. X  F. Disco                        P. Movie Sound Tracks
  169. X  G. Jazz                         Q. Easy listening
  170. X  H. Rhythm and Blues             R. Rap
  171. X  I. Classical                    S. Heavy Metal
  172. X  J. Classic Rock
  173. X
  174. Xs
  175. XHow would you feel recieving
  176. Xan obscene phone call?
  177. X  A. I would like it.
  178. X  B. It would be interesting.
  179. X  C. I would not like it.
  180. X
  181. Xc
  182. XWhich of the following comes closest
  183. Xto describing your social life?
  184. X  A. I hang out with a large crowd.
  185. X  B. I have a small circle of close friends.
  186. X  C. I have many acquaintances but not many
  187. X     truly close friends.
  188. X
  189. Xc
  190. XWhere would you prefer to live?
  191. X  A. Country
  192. X  B. City
  193. X  C. Suburbs
  194. X
  195. Xc
  196. XCurrent education level
  197. X  A. Did not finish high school
  198. X  B. High school
  199. X  C. Some college / Technical training
  200. X  D. Currently working toward 4 year degree
  201. X  E. 4 year degree
  202. X  F. Masters degree
  203. X  G. Doctorate degree
  204. X
  205. Xg
  206. XI consider myself
  207. X  A. Shy
  208. X  B. Outgoing
  209. X  C. Not shy but not outgoing either
  210. X
  211. Xc
  212. XWhat is your favorite social activity?
  213. X  A. Going to bars
  214. X  B. Cruising
  215. X  C. Concerts/Theater
  216. X  D. Going to the movies
  217. X  E. Watching T.V.
  218. X  F. Partying
  219. X  G. Dancing
  220. X  H. Playing BINGO
  221. X  I. Gab sessions
  222. X
  223. Xi
  224. XAre you emotionally open?
  225. X  A. I am warm and expressive
  226. X  B. I can usually express my feelings but sometimes
  227. X     I hold back
  228. X  C. I find it hard to express myself
  229. X  D. I never say what I feel
  230. X
  231. Xd
  232. XWhat is most important to you in a person?
  233. X  A. Kindness and understanding
  234. X  B. Assurance and decisiveness
  235. X  C. Money and power
  236. X  D. Education and intelligence
  237. X  E. Honesty and openness and trust
  238. X  F. Looks and build
  239. X
  240. Xf
  241. XHow important is sex to you?
  242. X  A. I can take it or leave it
  243. X  B. Sex is a natural part of a relationship
  244. X  C. Sex is a requirement in relationships
  245. X  D. I have never had sex
  246. X
  247. Xd
  248. XHow important is it to love your sex partner?
  249. X  A. Love is very important
  250. X  B. Love is semi-important
  251. X  C. Love is not important
  252. X  D. Love and sex? I never confuse the two
  253. X
  254. Xd
  255. XWhy are you using the Date-A-Base?
  256. X  A. To find new friends
  257. X  B. To find a steady lover
  258. X  C. To find a one night stand
  259. X  D. Just looking
  260. X
  261. Xd
  262. XI would rather watch a movie
  263. X  A. In the theater
  264. X  B. On Television
  265. X  C. In a 25 cent booth with a stack of quarters
  266. X
  267. Xc
  268. XIf you are truly in love
  269. X  A. Both should be faithful
  270. X  B. Fooling around with others is alright
  271. X  C. I pleed the 5th ammenddment
  272. X
  273. Xc
  274. XHow ambitious are you?
  275. X  A. Very ambitious
  276. X  B. Moderately ambitious
  277. X  C. Laid back
  278. X  D. Very lazy
  279. X
  280. Xd
  281. XDo you smoke?
  282. X  A. Do not smoke
  283. X  B. Light cigarette smoker
  284. X  C. Heavy cigarette smoker
  285. X
  286. Xc
  287. XWith regards to the telephone..
  288. X  A. I enjoy talking on the phone
  289. X  B. I hate the phone
  290. X  C. I use the phone only when necessary
  291. X
  292. Xc
  293. XWhat kind of television do you watch?
  294. X  A. Sitcoms
  295. X  B. Soaps
  296. X  C. Variety
  297. X  D. Movies
  298. X  E. Sports
  299. X  F. News
  300. X  G. Public TV
  301. X  H. Do not watch TV
  302. X
  303. Xh
  304. XWhich goal is most important to you?
  305. X  A. Wealth
  306. X  B. Knowledge
  307. X  C. Serenity
  308. X  D. Power
  309. X  E. Popularity
  310. X  F. Respectability
  311. X
  312. Xf
  313. XWhat kind of books do you like to read?
  314. X  A. Science fiction
  315. X  B. Classics
  316. X  C. Non-fiction / Technical
  317. X  D. Mysteries
  318. X  E. Poetry
  319. X  F. Novels
  320. X  G. Romance
  321. X
  322. Xg
  323. XWhen are usually the most alert?
  324. X  A. Morning
  325. X  B. Afternoon
  326. X  C. Early evening
  327. X  D. Late evening
  328. X
  329. Xd
  330. XHow would you describe your upbringing?
  331. X  A. Strict
  332. X  B. Average
  333. X  C. Permissive
  334. X  D. Indifferent
  335. X
  336. Xd
  337. XHow often do you usually date?
  338. X  A. Almost every night
  339. X  B. Once a week
  340. X  C. A few times a week
  341. X  D. A few times a month
  342. X  E. Irregularly
  343. X  F. Never
  344. X
  345. Xf
  346. XWhat would your ideal relationship be?
  347. X  A. Exciting
  348. X  B. Platonic
  349. X  C. Varied
  350. X  D. Casual
  351. X  E. Physical
  352. X  F. Exclusive
  353. X  G. Intense
  354. X  H. Sensible
  355. X  I. Intimate
  356. X  J. Long-lived
  357. X  K. Undemanding
  358. X  L. Considerate
  359. X  M. Romantic
  360. X
  361. Xm
  362. XWhat sort of people are you most comfotable with?
  363. X  A. Outdoors types
  364. X  B. Artists
  365. X  C. Average folks
  366. X  D. Intellectuals
  367. X  E. Working people
  368. X  F. Professionals
  369. X  G. Cultured individuals
  370. X
  371. Xg
  372. XWho do you live with?
  373. X  A. Alone
  374. X  B. With roomate
  375. X  C. With lover
  376. X  D. With parents
  377. X  E. With spouse
  378. X
  379. Xe
  380. XHonestly - how is your body?
  381. X  A. I am in top shape
  382. X  B. I am in shape
  383. X  C. I go to the gym occasionally
  384. X  D. Do not ask me about my body
  385. X
  386. Xd
  387. XI consider myself...
  388. X  A. A real knockout - guaranteed
  389. X  B. Very good looking
  390. X  C. I am pretty cute
  391. X  D. Average / Not bad
  392. X  E. I make up for it in other ways
  393. X
  394. Xe
  395. XWould you be interested in meeting your match?
  396. X  A. Yes
  397. X  B. No
  398. X  C. Only if I am contacted first
  399. X
  400. Xc
  401. X
  402. END_OF_Questions
  403. if test 6299 -ne `wc -c <Questions`; then
  404.     echo shar: \"Questions\" unpacked with wrong size!
  405. fi
  406. # end of overwriting check
  407. fi
  408. if test -f README -a "${1}" != "-c" ; then 
  409.   echo shar: Will not over-write existing file \"README\"
  410. else
  411. echo shar: Extracting \"README\" \(486 characters\)
  412. sed "s/^X//" >README <<'END_OF_README'
  413. XWell, here is a computer dating service I have just finished.
  414. XIf features a 40 question questionaire and matches people up by
  415. Xpercentage with MOTOS. There are 2 versions available.
  416. X
  417. XVersion 1.0: requires only a Pascal Compiler
  418. X
  419. XVersion 2.0: designed to run under unix 4.3 bsd. It has all the options
  420. X         of version 1 plus more. It may run under other versions
  421. X         of unix, if your system supports the features it requires.
  422. X
  423. X
  424. X                Tom
  425. X                     john1233@csd4.milw.wisc.edu
  426. END_OF_README
  427. if test 486 -ne `wc -c <README`; then
  428.     echo shar: \"README\" unpacked with wrong size!
  429. fi
  430. # end of overwriting check
  431. fi
  432. if test -f bbase -a "${1}" != "-c" ; then 
  433.   echo shar: Will not over-write existing file \"bbase\"
  434. else
  435. echo shar: Extracting \"bbase\" \(3800 characters\)
  436. sed "s/^X//" >bbase <<'END_OF_bbase'
  437. Xweight: 
  438. Xh
  439. XUnder 100 lbs.
  440. X100 lbs-125 lbs.
  441. X125 lbs-140 lbs.
  442. X140 lbs-160 lbs.
  443. X160 lbs-180 lbs.
  444. X180 lbs-200 lbs.
  445. X200 lbs-220 lbs.
  446. XOver 220 lbs.
  447. Xheight: 
  448. Xf
  449. XUnder 5 ft.
  450. X5 ft-5 ft. 4 in.
  451. X5 ft. 4 in. - 5 ft. 7 in.
  452. X5 ft. 7 in. - 5 ft. 10 in.
  453. X5 ft. 10 in. - 6 ft.
  454. XOver 6 ft.
  455. Xhair: 
  456. Xg
  457. XBrown
  458. XBlack
  459. XRed
  460. XBlond
  461. XGray
  462. XAuburn
  463. XBald
  464. Xeyes: 
  465. Xf
  466. XBrown
  467. XBlue
  468. XHazel
  469. XGreen
  470. XViolet
  471. XGray
  472. Xage: 
  473. Xh
  474. XLess than 18
  475. X18-20
  476. X21-23
  477. X24-27
  478. X28-32
  479. X33-40
  480. X41-50
  481. XOver 50
  482. Xdress: 
  483. Xf
  484. XPreppie
  485. XCasual
  486. XJeans and T-shirt
  487. XSleezy
  488. XDressy
  489. XConservatively
  490. Xethnic: 
  491. Xe
  492. XWhite
  493. XBlack
  494. XHispanic
  495. XOriental/Asian
  496. XIndian
  497. Xstatus: 
  498. Xd
  499. XSingle
  500. XSeparated/Divorced
  501. XWidow/Widower
  502. XMarried
  503. Xrate: 
  504. Xe
  505. XUnder 5
  506. X5 to 6
  507. X7 to 8
  508. X9 to 10
  509. XOver 10
  510. Xhobby: 
  511. Xt
  512. XSports
  513. XDancing
  514. XConcerts
  515. XTravel
  516. XTheater
  517. XReading
  518. XDomestics
  519. XSex
  520. XWatching television
  521. XShopping
  522. XCamping
  523. XComputers / Electronics
  524. XPolitics
  525. XListening to music
  526. XPhotography
  527. XArts and Crafts
  528. XCooking
  529. XDancing
  530. XCars / Mechanics
  531. XWork / Career
  532. Xmusic: 
  533. Xs
  534. XRock
  535. XPop
  536. XNew Wave
  537. XPunk
  538. XSoul
  539. XDisco
  540. XJazz
  541. XRhythm and Blues
  542. XClassical
  543. XOpera
  544. XFolk
  545. XCountry and Western
  546. XGospel
  547. XElectronic
  548. XMovie Sound Tracks
  549. XEasy listening
  550. XRap
  551. XHeavy Metal
  552. XClassic Rock
  553. Xobscene phone call: 
  554. Xc
  555. XI would like it.
  556. XIt would be interesting.
  557. XI would not like it.
  558. Xfriends: 
  559. Xc
  560. XI hang out with a large crowd.
  561. XI have a small circle of close friends.
  562. Xmany acquaintances not close friends.
  563. Xlive: 
  564. Xc
  565. XCountry
  566. XCity
  567. XSuburbs
  568. Xeducation: 
  569. Xg
  570. XDid not finish high school
  571. XHigh school
  572. XSome college / Technical training
  573. XCurrently working toward 4 year degree
  574. X4 year degree
  575. XMasters degree
  576. XDoctorate degree
  577. Xshy: 
  578. Xc
  579. XShy
  580. XOutgoing
  581. XNot shy but not outgoing either
  582. Xsocial life: 
  583. Xi
  584. XGoing to bars
  585. XCruising
  586. XConcerts/Theater
  587. XGoing to the movies
  588. XWatching T.V.
  589. XPartying
  590. XDancing
  591. XPlaying BINGO
  592. XGab sessions
  593. Xopeness: 
  594. Xd
  595. XI am warm and expressive
  596. XUsually express, sometimes hold back
  597. XI find it hard to express myself
  598. XI never say what I feel
  599. Ximportant in a person: 
  600. Xf
  601. XKindness and understanding
  602. XAssurance and decisiveness
  603. XMoney and power
  604. XEducation and intelligence
  605. XHonesty and openness and trust
  606. XLooks and build
  607. Xsex: 
  608. Xd
  609. XI can take it or leave it
  610. XSex is a natural part of a relationship
  611. XSex is a requirement in relationships
  612. XI have never had sex
  613. Xlove sex partner: 
  614. Xd
  615. XLove is very important
  616. XLove is semi-important
  617. XLove is not important
  618. XLove and sex? I never confuse the two
  619. Xwhy here: 
  620. Xd
  621. XTo find new friends
  622. XTo find a steady lover
  623. XTo find a one night stand
  624. XJust looking
  625. Xmovie: 
  626. Xc
  627. XIn the theater
  628. XOn Television
  629. XIn a 25 cent booth with a stack of quarters
  630. Xtruly in love: 
  631. Xc
  632. XBoth should be faithful
  633. XFooling around with others is alright
  634. XI pleed the 5th ammenddment
  635. Xambition: 
  636. Xd
  637. XVery ambitious
  638. XModerately ambitious
  639. XLaid back
  640. XVery lazy
  641. Xsmoke: 
  642. Xc
  643. XDo not smoke
  644. XLight smoker
  645. XHeavy smoker
  646. Xtelephone: 
  647. Xc
  648. XI enjoy talking on the phone
  649. XI hate the phone
  650. XI use the phone only when necessary
  651. Xtelevision: 
  652. Xh
  653. XSitcoms
  654. XSoaps
  655. XVariety
  656. XMovies
  657. XSports
  658. XNews
  659. XPublic TV
  660. XDo not watch TV
  661. Xgoal: 
  662. Xf
  663. XWealth
  664. XKnowledge
  665. XSerenity
  666. XPower
  667. XPopularity
  668. XRespectability
  669. Xbooks: 
  670. Xg
  671. XScience fiction
  672. XClassics
  673. XNon-fiction / Technical
  674. XMysteries
  675. XPoetry
  676. XNovels
  677. XRomance
  678. Xalert: 
  679. Xd
  680. XMorning
  681. XAfternoon
  682. XEarly evening
  683. XLate evening
  684. Xupbringing: 
  685. Xd
  686. XStrict
  687. XAverage
  688. XPermissive
  689. XIndifferent
  690. Xdate: 
  691. Xf
  692. XAlmost every night
  693. XOnce a week
  694. XA few times a week
  695. XA few times a month
  696. XIrregularly
  697. XNever
  698. Xideal relationship: 
  699. Xm
  700. XExciting
  701. XPlatonic
  702. XVaried
  703. XCasual
  704. XPhysical
  705. XExclusive
  706. XIntense
  707. XSensible
  708. XIntimate
  709. XLong-lived
  710. XUndemanding
  711. XConsiderate
  712. XRomantic
  713. Xpeople comfortable with: 
  714. Xg
  715. XOutdoors types
  716. XArtists
  717. XAverage folks
  718. XIntellectuals
  719. XWorking people
  720. XProfessionals
  721. XCultured individuals
  722. Xlive with: 
  723. Xe
  724. XAlone
  725. XWith roommate
  726. XWith lover
  727. XWith parents
  728. XWith spouse
  729. Xbody: 
  730. Xd
  731. XI am in top shape
  732. XI am in shape
  733. XI go the gym occasionally
  734. XDo not ask me about my body
  735. Xconsider myself: 
  736. Xe
  737. XA real knockout - guaranteed
  738. XVery good looking
  739. XPretty cute
  740. XAverage / not bad
  741. XMake up for it in other ways
  742. Xmeeting match: 
  743. Xc
  744. XYes
  745. XNo
  746. XOnly if I am contacted first
  747. X
  748. END_OF_bbase
  749. if test 3800 -ne `wc -c <bbase`; then
  750.     echo shar: \"bbase\" unpacked with wrong size!
  751. fi
  752. # end of overwriting check
  753. fi
  754. if test -f date.doc.v1 -a "${1}" != "-c" ; then 
  755.   echo shar: Will not over-write existing file \"date.doc.v1\"
  756. else
  757. echo shar: Extracting \"date.doc.v1\" \(2026 characters\)
  758. sed "s/^X//" >date.doc.v1 <<'END_OF_date.doc.v1'
  759. X               Docs for Date-A-Base version 1
  760. X
  761. XFirst you must have the following files in your directory called:
  762. X                     bbase
  763. X             Questions
  764. X
  765. Xthen you must also issue:
  766. X         touch database
  767. X
  768. XThe actual program file is
  769. X        date.v1.p
  770. X
  771. XTo run the programs you must
  772. X
  773. Xpc date.v1.p 
  774. X
  775. Xyou can then ReMove date.v1.p 
  776. Xand rename the a.out file.
  777. X
  778. Xso here are the commands:
  779. X         touch database
  780. X         pc date.v1.p 
  781. X         mv a.out datingame
  782. X
  783. XJust type 'datingame' and away it goes.
  784. X
  785. XThere is a copyright on the program. This doesn't mean you can't give it
  786. Xaway or modify it. It only means that my name is to appear in the 'bye'
  787. Xprocedure and the commented header.
  788. X
  789. XTechnical stuff
  790. X---------------
  791. X
  792. XVersion 1.0 of the Date-A-Base is designed to be 100% standard Pascal.
  793. XThis is so it can be run on any machine with a Pascal compiler.
  794. X
  795. XVersion 2.0 is available with extra options. 2 of these options will
  796. Xprobably work on most machines but they were left out on purpose.
  797. X
  798. XFirst, the use of the wallclock function. Wallclock returns the number
  799. Xof seconds since Jan. 1, 1970. I have left references to the wallclock in
  800. X(* comments *). If you computer has a wallclock or functionally similar
  801. Xfunction, just erase the (* comments *) and if needed, rename the function.
  802. X
  803. XAlso, you can change the reset() and rewrite() functions to point to
  804. Xdifferent directories. Version 2.0 uses a .date directory to
  805. Xhold the database, bbase and Questions files.
  806. XTo to this you must:
  807. X         mkdir .date
  808. X         cp Questions .date/Questions
  809. X         cp bbase .date/bbase
  810. X         touch .date/database
  811. X
  812. Xyou must also change all the reset() and rewite() functions. 
  813. XEx.          reset(database, '.date/database');
  814. X
  815. XThe actual name of the file must be in single quotes.
  816. X
  817. XThe wallclock and reset(pathname) rewrite(pathname) are no available
  818. Xto all versions of Pascal. Check before you try them.
  819. X
  820. X
  821. X               Thomas M. Johnson
  822. X                            
  823. X                   john1233@csd4.milw.wisc.edu
  824. X                            or
  825. X                               tommyj@lakesys
  826. END_OF_date.doc.v1
  827. if test 2026 -ne `wc -c <date.doc.v1`; then
  828.     echo shar: \"date.doc.v1\" unpacked with wrong size!
  829. fi
  830. # end of overwriting check
  831. fi
  832. if test -f date.doc.v2 -a "${1}" != "-c" ; then 
  833.   echo shar: Will not over-write existing file \"date.doc.v2\"
  834. else
  835. echo shar: Extracting \"date.doc.v2\" \(1566 characters\)
  836. sed "s/^X//" >date.doc.v2 <<'END_OF_date.doc.v2'
  837. X               Docs for Date-A-Base version 2
  838. X
  839. XFirst you must copy the following files into a directory called:
  840. X              .date
  841. X
  842. XThe files are:       bbase
  843. X             Questions
  844. X
  845. Xthen into this directory you must also issue:
  846. X         touch database
  847. X
  848. XThe actual program files are
  849. X        date.v2.p
  850. X        getw.c
  851. X        getw.h
  852. X
  853. XTo run the programs you must
  854. X
  855. Xcc -c getw.c
  856. X
  857. XThen:
  858. X
  859. Xpc date.v2.p getw.o
  860. X
  861. Xyou can then ReMove date.v2.p, getw.c, getw.o, date.o and getw.h
  862. Xand rename the a.out file.
  863. X
  864. Xso here are the commands:
  865. X         mkdir .date
  866. X         cp Questions .date/Questions
  867. X         cp bbase .date/bbase
  868. X         touch .date/database
  869. X         cc -c getw.c
  870. X         pc date.v2.p getw.o
  871. X         mv a.out datingame
  872. X
  873. XJust type 'datingame' and away it goes.
  874. X
  875. XThere is a copyright on the program. This doesn't mean you can't give it
  876. Xaway or modify it. It only means that my name is to appear in the 'bye'
  877. Xprocedure and the commented header.
  878. X
  879. XTechnical stuff
  880. X---------------
  881. X
  882. XThe differences between version 1.0 and 2.0 are:
  883. X
  884. XIn 2.0, the user no longer has to enter his own name. His login name
  885. Xis automatically placed in the Date-A-Base.
  886. X
  887. XVersion 2.0 also support the wallclock function. The wallclock function
  888. Xreturns the number of seconds that have passed since Jan. 1, 1970.
  889. XThis may be called something else on your system, so you can modify the
  890. Xsource to any function that is functionally the same.
  891. X
  892. XIn version 2.0 the data files (database, bbase and Questions) are places
  893. Xin a hidden directory (.date). These can be moved to any directory as 
  894. Xlong as you change the 'reset' commands.
  895. X
  896. X               Thomas M. Johnson
  897. X
  898. END_OF_date.doc.v2
  899. if test 1566 -ne `wc -c <date.doc.v2`; then
  900.     echo shar: \"date.doc.v2\" unpacked with wrong size!
  901. fi
  902. # end of overwriting check
  903. fi
  904. if test -f date.v1.p -a "${1}" != "-c" ; then 
  905.   echo shar: Will not over-write existing file \"date.v1.p\"
  906. else
  907. echo shar: Extracting \"date.v1.p\" \(14598 characters\)
  908. sed "s/^X//" >date.v1.p <<'END_OF_date.v1.p'
  909. Xprogram date(input, output, Questions, database, bbase);
  910. X
  911. X(*
  912. X            Date-A-Base version 1.0
  913. X                   by
  914. X                         Thomas M. Johnson
  915. X
  916. X             john1233@csd4.milw.wisc.edu
  917. X                  or
  918. X                             tommyj@lakesys
  919. X
  920. X     files used:
  921. X       Questions - holds the questionaire
  922. X       database  - all people registered with the Date-A-Base
  923. X               and their information
  924. X           bbase     - data used by brouse command.
  925. X
  926. X(c) 1987 Thomas M. Johnson *)
  927. X
  928. X
  929. X
  930. X
  931. Xconst
  932. X    NUMOFQUESTIONS = 49;
  933. X    STRINGLENGTH = 20;
  934. X    ONE = 1;
  935. X    LOW = 'a';
  936. X
  937. Xtype
  938. X    string = packed array [ONE..STRINGLENGTH] of char;
  939. X    answerarray = packed array [ONE..NUMOFQUESTIONS] of char;
  940. X    userp = ^ usertype;
  941. X    usertype = 
  942. X    record 
  943. X        login: string;
  944. X        passwd: string;
  945. X        sex: char;
  946. X        timeson: integer;
  947. X        answers: answerarray;
  948. X(*        laston: integer;   *)
  949. X        next: userp
  950. X    end;
  951. X
  952. Xvar
  953. X    Questions: text;
  954. X    database: file of usertype;
  955. X    head: userp;
  956. X    static: usertype;
  957. X    bbase: text;
  958. X    continue: boolean;
  959. X
  960. X
  961. X
  962. X    function cstrings(var string1: answerarray; string2: answerarray): real;
  963. X
  964. X    (* The function cstrings takes 2 strings and compares them.
  965. X       cstrings then returns the percent identical the strings are.
  966. X       The strings are compared letter for letter and must be in the
  967. X       same place in the string.                               *)
  968. X
  969. X
  970. X    var
  971. X    counter: integer;
  972. X    percent: integer;
  973. X
  974. X    begin
  975. X    percent := 0;
  976. X
  977. X    for counter := ONE to NUMOFQUESTIONS do 
  978. X        if string1[counter] = string2[counter] then 
  979. X        percent := percent + 1;
  980. X    cstrings := percent / NUMOFQUESTIONS * 100
  981. X    end; { cstrings }
  982. X
  983. X    function yesNo: boolean;
  984. X
  985. X    const
  986. X    yes = 'y';
  987. X    no = 'n';
  988. X
  989. X    var
  990. X    ch: char;
  991. X
  992. X    begin
  993. X    repeat
  994. X        write(output, ' (y/n) ');
  995. X        readln(input, ch)
  996. X    until (ch = yes) or (ch = no);
  997. X    yesNo := ch = yes
  998. X
  999. X    end; { yesNo }
  1000. X
  1001. X
  1002. X
  1003. X    function getanswer(ubound: char): char;
  1004. X
  1005. X    (* The function getanswer reads in a character and checks to see
  1006. X       if it is in the range of lobound to ubound. If it isn't, then the
  1007. X       user is reprompted.                                          *)
  1008. X
  1009. X
  1010. X    var
  1011. X    tempchar: char;
  1012. X    charindex: char;
  1013. X
  1014. X    begin
  1015. X    repeat
  1016. X        writeln(output);
  1017. X
  1018. X        for charindex := LOW to ubound do 
  1019. X        write(output, charindex);
  1020. X
  1021. X        writeln(output);
  1022. X        write(output, 'Your choice: ');
  1023. X        readln(input, tempchar)
  1024. X    until (tempchar >= LOW) and (tempchar <= ubound);
  1025. X
  1026. X    writeln(output);
  1027. X    getanswer := tempchar
  1028. X    end; { getanswer }
  1029. X
  1030. X
  1031. X    procedure readstring(var tempstring: string);
  1032. X
  1033. X    (* read a string from standard input. the string must have
  1034. X       a length of 2 or greater or it is invalid.   *)
  1035. X
  1036. X
  1037. X    const
  1038. X    init = 0;
  1039. X    inc = 1;
  1040. X    blank = '                    ';
  1041. X
  1042. X    var
  1043. X    ch: char;
  1044. X    length: integer;
  1045. X
  1046. X    begin
  1047. X    repeat
  1048. X        tempstring := blank;
  1049. X        length := init;
  1050. X        while not eoln(input) do begin
  1051. X        read(input, ch);
  1052. X        length := length + inc;
  1053. X        tempstring[length] := ch
  1054. X        end;
  1055. X        readln(input)
  1056. X    until length > 1
  1057. X
  1058. X    end; { readstring }
  1059. X
  1060. X    procedure readint(var sum: integer);
  1061. X
  1062. X    (* read in a string from standard input and convert to an
  1063. X       integer.     *)
  1064. X
  1065. X
  1066. X    const
  1067. X    init = 0;
  1068. X    inc = 1;
  1069. X    base = 10;
  1070. X    intlow = '0';
  1071. X    inthigh = '9';
  1072. X
  1073. X    var
  1074. X    i: integer;
  1075. X    done: boolean;
  1076. X    hold: string;
  1077. X
  1078. X    begin
  1079. X    i := inc;
  1080. X    done := false;
  1081. X    sum := init;
  1082. X    readstring(hold);
  1083. X    while (i <= STRINGLENGTH) and not done do 
  1084. X        if (hold[i] < intlow) or (hold[i] > inthigh) then 
  1085. X        done := true
  1086. X        else begin
  1087. X        sum := sum * base + (ord(hold[i]) - ord(intlow));
  1088. X        if sum > maxint then 
  1089. X            done := true
  1090. X        else 
  1091. X            i := i + inc
  1092. X        end
  1093. X    end; { readint }
  1094. X
  1095. X
  1096. X
  1097. X    procedure printques(var quests: answerarray);
  1098. X
  1099. X    (* prints the questions from the file Questions.
  1100. X       the question file is set up like:
  1101. X    
  1102. X       The question
  1103. X       the answers
  1104. X               .
  1105. X               .
  1106. X               .
  1107. X               .
  1108. X       ^G (up limit)
  1109. X    
  1110. X       then ^G is just a marker to signify where the answers end.
  1111. X       low limit is usually and 'a'
  1112. X       up limit the the last answer
  1113. X    
  1114. X       *)
  1115. X
  1116. X    var
  1117. X    ch: char;
  1118. X    uplimit: char;
  1119. X    chset: set of char;
  1120. X    i: integer;
  1121. X
  1122. X    begin
  1123. X    reset(Questions);
  1124. X    i := 1;
  1125. X    chset := ['A'..'Z', 'a'..'z', '0'..'9', '?', '.', ' ', '-', '/'];
  1126. X    ch := ' ';
  1127. X    while not eof(Questions) do begin
  1128. X        while not eoln(Questions) do begin
  1129. X        read(Questions, ch);
  1130. X        if ch in chset then 
  1131. X            write(output, ch)
  1132. X        else begin
  1133. X            readln(Questions, uplimit);
  1134. X            quests[i] := getanswer(uplimit);
  1135. X            i := i + 1
  1136. X        end
  1137. X        end;
  1138. X        readln(Questions);
  1139. X        writeln(output)
  1140. X    end
  1141. X    end; { printques }
  1142. X
  1143. X    function Search(lookfor: string; var hisrec: usertype): boolean;
  1144. X
  1145. X    (* scan the linked list to find a match between the string lookfor 
  1146. X       and the .login field. If there is a match, a true is returned with
  1147. X       the record of that person. Otherwise a false is returned *)
  1148. X
  1149. X
  1150. X    var
  1151. X    found: boolean;
  1152. X    temptr: userp;
  1153. X
  1154. X    begin
  1155. X    found := false;
  1156. X    temptr := head;
  1157. X
  1158. X    while (temptr <> nil) and not found do 
  1159. X        if temptr^.login = lookfor then begin
  1160. X        hisrec := temptr^;
  1161. X        found := true
  1162. X        end else 
  1163. X        temptr := temptr^.next;
  1164. X
  1165. X    Search := found
  1166. X    end; { Search }
  1167. X
  1168. X
  1169. X    procedure newUser;
  1170. X
  1171. X    (* if the person in not in the linked list, add him *)
  1172. X
  1173. X
  1174. X    const
  1175. X    male = 'm';
  1176. X    female = 'f';
  1177. X    inc = 1;
  1178. X
  1179. X    var
  1180. X    ch: char;
  1181. X    node: userp;
  1182. X
  1183. X
  1184. X
  1185. X    begin
  1186. X    writeln(output, 'To use the Date-A-Base you will have to answer a');
  1187. X    writeln(output, 'personal questionaire. Your answers to all the');
  1188. X    writeln(output, 'questions will available for anyone registered');
  1189. X    writeln(output, 'in the Date-A-Base to look at.');
  1190. X    writeln(output);
  1191. X    writeln(output, 'Do you want to continue? ');
  1192. X    continue := yesNo;
  1193. X    if continue then begin
  1194. X        repeat
  1195. X        writeln(output);
  1196. X        writeln(output, 'What sex are you? m or f');
  1197. X        readln(input, ch)
  1198. X        until (ch = male) or (ch = female);
  1199. X        static.sex := ch;
  1200. X        with static do begin
  1201. X        timeson := inc
  1202. X        end;
  1203. X
  1204. X(*        laston := wallclock   *)
  1205. X        printques(static.answers);
  1206. X        writeln(output);
  1207. X        writeln(output, 'What password do you want to use?');
  1208. X        writeln(output, 'IMPORTANT: Make this different than');
  1209. X        writeln(output, 'your login password.');
  1210. X        readstring(static.passwd);
  1211. X        new(node);
  1212. X        node^ := static;
  1213. X        node^.next := head;
  1214. X        head := node
  1215. X    end
  1216. X    end; { newUser }
  1217. X
  1218. X
  1219. X
  1220. X
  1221. X    procedure oldUser;
  1222. X
  1223. X    (* the person is already registered. Just get his data. *)
  1224. X
  1225. X
  1226. X    const
  1227. X
  1228. X
  1229. X    inc = 1;
  1230. X    var
  1231. X    password: string;
  1232. X    temptr: userp;
  1233. X    found: boolean;
  1234. X
  1235. X
  1236. X    begin
  1237. X    repeat
  1238. X        writeln(output);
  1239. X        writeln(output, 'What is your password?');
  1240. X        write(output, '? ');
  1241. X        readstring(password);
  1242. X        if password <> static.passwd then 
  1243. X        writeln(output, 'Sorry, thats not right!')
  1244. X    until password = static.passwd;
  1245. X    with static do begin
  1246. X        timeson := timeson + inc
  1247. X    end;
  1248. X
  1249. X(*        laston := wallclock   *)
  1250. X    temptr := head;
  1251. X    found := false;
  1252. X    while (temptr <> nil) and not found do 
  1253. X        if temptr^.login = static.login then begin
  1254. X        static.next := temptr^.next;
  1255. X        temptr^ := static;
  1256. X        found := true
  1257. X        end else 
  1258. X        temptr := temptr^.next
  1259. X
  1260. X    end; { oldUser }
  1261. X
  1262. X
  1263. X
  1264. X    procedure initialize;
  1265. X
  1266. X    (* This procedure reads in the current file with all registered
  1267. X       users into a linked list. *)
  1268. X
  1269. X
  1270. X    var
  1271. X    node: userp;
  1272. X    name: string;
  1273. X
  1274. X    begin
  1275. X    head := nil;
  1276. X    reset(database);
  1277. X    while not eof(database) do begin
  1278. X        new(node);
  1279. X        read(database, node^);
  1280. X        node^.next := head;
  1281. X        head := node
  1282. X    end; (* while *)
  1283. X    writeln(output);
  1284. X    writeln(output);
  1285. X    writeln(output, '                 The');
  1286. X    writeln(output, '            Date-A-Base');
  1287. X    writeln(output);
  1288. X    writeln(output);
  1289. X    writeln(output, '  The computerized dating service.');
  1290. X    writeln(output);
  1291. X    writeln(output);
  1292. X    writeln(output);
  1293. X    writeln(output, 'What is your login name?');
  1294. X    write(output, '? ');
  1295. X    continue := true;
  1296. X    readstring(name);
  1297. X    static.login := name;
  1298. X    if not Search(name, static) then 
  1299. X        newUser
  1300. X    else 
  1301. X        oldUser
  1302. X
  1303. X
  1304. X    end; { initialize }
  1305. X
  1306. X    procedure savedata;
  1307. X
  1308. X    (* save the linked list in the file database *)
  1309. X
  1310. X
  1311. X    var
  1312. X    pointer: userp;
  1313. X
  1314. X
  1315. X    begin
  1316. X    rewrite(database);
  1317. X    pointer := head;
  1318. X    if pointer <> nil then 
  1319. X        while pointer^.next <> nil do begin
  1320. X        write(database, pointer^);
  1321. X        pointer := pointer^.next
  1322. X        end;
  1323. X    write(database, pointer^)
  1324. X
  1325. X    end; { savedata }
  1326. X
  1327. X    procedure answer;
  1328. X
  1329. X    (* answer the questionaire again *)
  1330. X
  1331. X
  1332. X    var
  1333. X    check: boolean;
  1334. X    temptr: userp;
  1335. X    found: boolean;
  1336. X
  1337. X    begin
  1338. X    writeln(output);
  1339. X    writeln(output, 'Are you sure you want to answer all the');
  1340. X    writeln(output, 'questions again?');
  1341. X    check := yesNo;
  1342. X    if check then 
  1343. X        printques(static.answers);
  1344. X    temptr := head;
  1345. X    found := false;
  1346. X    while (temptr <> nil) and not found do 
  1347. X        if temptr^.login = static.login then begin
  1348. X        static.next := temptr^.next;
  1349. X        temptr^ := static;
  1350. X        found := true
  1351. X        end else 
  1352. X        temptr := temptr^.next
  1353. X
  1354. X    end; { answer }
  1355. X
  1356. X    procedure brouse;
  1357. X
  1358. X    (* give a quick scan of someone else's questionaire. the data for
  1359. X       the brouse is in bbase. Data looks like:
  1360. X    
  1361. X              the topic
  1362. X              the maximum answer
  1363. X              answer
  1364. X                .
  1365. X                .
  1366. X                .
  1367. X    
  1368. X                *)
  1369. X
  1370. X
  1371. X    const
  1372. X(*    clicks = 86400;      *)
  1373. X    (* number of seconds in a day *)
  1374. X    low = 'a';
  1375. X    field = 3;
  1376. X    zero = 0;
  1377. X    marker = 15;
  1378. X
  1379. X    var
  1380. X    who: string;
  1381. X    index: char;
  1382. X    ch: char;
  1383. X    max: char;
  1384. X    i: integer;
  1385. X    j: integer;
  1386. X(*    time: integer;    *)
  1387. X    rec: usertype;
  1388. X
  1389. X    begin
  1390. X    writeln(output, 'Whose questionare do you want to brouse?');
  1391. X    write(output, '? ');
  1392. X    readstring(who);
  1393. X    if Search(who, rec) then begin
  1394. X
  1395. X        i := ONE;
  1396. X        j := ONE;
  1397. X        reset(bbase);
  1398. X        writeln(output);
  1399. X        write(output, 'Name: ');
  1400. X        writeln(output, rec.login);
  1401. X        write(output, 'Used the Date-A-Base ');
  1402. X        write(output, rec.timeson: field);
  1403. X        if rec.timeson = ONE then 
  1404. X        writeln(output, ' time. ')
  1405. X        else 
  1406. X        writeln(output, ' times. ');
  1407. X
  1408. X        write(output, 'Last used the Date-A-Base: ');
  1409. X        (*    time := wallclock - rec.laston;
  1410. X                    time := time div clicks;
  1411. X                    if time = zero then 
  1412. X                    writeln(output, 'today.');
  1413. X                    if time = ONE then 
  1414. X                    writeln(output, 'yesterday.');
  1415. X                    if time > ONE then begin
  1416. X                    write(output, time: field);
  1417. X                    writeln(output, ' days ago.')
  1418. X                    end;  *)
  1419. X
  1420. X        writeln(output);
  1421. X        while not eof(bbase) do begin
  1422. X        while not eoln(bbase) do begin
  1423. X            read(bbase, ch);
  1424. X            write(output, ch)
  1425. X        end;
  1426. X        readln(bbase);
  1427. X        readln(bbase, max);
  1428. X        for index := low to max do begin
  1429. X            if index = rec.answers[i] then begin
  1430. X            while not eoln(bbase) do begin
  1431. X                read(bbase, ch);
  1432. X                write(output, ch)
  1433. X            end;
  1434. X            writeln(output);
  1435. X            readln(bbase)
  1436. X            end else 
  1437. X            readln(bbase)
  1438. X        end;
  1439. X        if j = marker then begin
  1440. X            repeat
  1441. X            writeln(output);
  1442. X            writeln(output, 'Continue? ')
  1443. X            until yesNo;
  1444. X            j := zero;
  1445. X            writeln(output)
  1446. X        end;
  1447. X        j := j + ONE;
  1448. X        i := i + ONE
  1449. X        end
  1450. X    end else 
  1451. X        writeln(output, 'Sorry that person is not registered!');
  1452. X
  1453. X    repeat
  1454. X        writeln(output);
  1455. X        writeln(output, 'Return to the menu? ')
  1456. X    until yesNo
  1457. X    end; { brouse }
  1458. X
  1459. X    procedure delete;
  1460. X
  1461. X    (* delete a person from the linked list *)
  1462. X
  1463. X    var
  1464. X    found: boolean;
  1465. X    pointer: userp;
  1466. X
  1467. X    begin
  1468. X    found := false;
  1469. X    writeln(output, 'Are you sure you want to delete yourself?');
  1470. X    if yesNo then begin
  1471. X        pointer := head;
  1472. X        if pointer^.login = static.login then begin
  1473. X        head := pointer^.next;
  1474. X        dispose(pointer)
  1475. X        end else 
  1476. X        while not found do 
  1477. X            while pointer^.next <> nil do 
  1478. X            if pointer^.next^.login = static.login then begin
  1479. X                pointer^.next := pointer^.next^.next;
  1480. X                dispose(pointer^.next);
  1481. X                found := true
  1482. X            end else 
  1483. X                pointer := pointer^.next
  1484. X    end
  1485. X    end; { delete }
  1486. X
  1487. X
  1488. X
  1489. X
  1490. X
  1491. X    procedure match;
  1492. X
  1493. X    (* find a match between 2 people. scans the whole linked list
  1494. X       and reports all matches greater than the amount entered. *)
  1495. X
  1496. X
  1497. X    const
  1498. X    loginfield = 47;
  1499. X    perfield = 5;
  1500. X    dplaces = 1;
  1501. X    namefield = 33;
  1502. X    low = 9;
  1503. X    high = 100;
  1504. X
  1505. X
  1506. X    var
  1507. X    pointer: userp;
  1508. X    percent: integer;
  1509. X    per: real;
  1510. X    found: boolean;
  1511. X
  1512. X
  1513. X    begin
  1514. X    pointer := head;
  1515. X    writeln(output);
  1516. X    writeln(output, 'What is the lowest percent match that');
  1517. X    writeln(output, 'you want to see? ');
  1518. X    repeat
  1519. X        write(output, ' (10 - 99) ');
  1520. X
  1521. X        readint(percent)
  1522. X    until (percent > low) and (percent < high);
  1523. X
  1524. X
  1525. X    writeln(output);
  1526. X    write(output, '%': perfield);
  1527. X    writeln(output, 'name': namefield);
  1528. X    writeln(output, '----------------------------------------------------');
  1529. X
  1530. X    found := false;
  1531. X    if pointer <> nil then 
  1532. X        while pointer <> nil do begin
  1533. X        per := cstrings(static.answers, pointer^.answers);
  1534. X        if (per >= percent) and (static.sex <> pointer^.sex) then begin
  1535. X            found := true;
  1536. X            writeln(output);
  1537. X            write(output, per: perfield: dplaces);
  1538. X            write(output, '%');
  1539. X            writeln(output, pointer^.login: loginfield)
  1540. X        end;
  1541. X        pointer := pointer^.next
  1542. X        end;
  1543. X    if not found then begin
  1544. X        writeln(output);
  1545. X        writeln(output, 'Sorry, no matches found today. Try again later.')
  1546. X    end;
  1547. X    repeat
  1548. X        writeln(output);
  1549. X        writeln(output);
  1550. X        writeln(output, 'Are you ready to continue?')
  1551. X    until yesNo
  1552. X
  1553. X    end; { match }
  1554. X
  1555. X
  1556. X    procedure bye;
  1557. X
  1558. X    begin
  1559. X    writeln(output);
  1560. X    writeln(output, 'Thank you for using the Date-A-Base');
  1561. X    writeln(output, 'Hope to hear from you again soon.');
  1562. X    writeln(output);
  1563. X    writeln(output);
  1564. X    writeln(output);
  1565. X    writeln(output);
  1566. X    writeln(output);
  1567. X    writeln(output,'(c) 1987 Thomas M. Johnson');
  1568. X    writeln(output)
  1569. X    end; { bye }
  1570. X
  1571. X
  1572. X    procedure menu;
  1573. X
  1574. X    (* The procedure menu is the programs main menu. It prints the
  1575. X       commands and executes the proper subroutine based on the users
  1576. X       choice.                                                  *)
  1577. X
  1578. X
  1579. X    const
  1580. X
  1581. X    lastchoice = 'e';
  1582. X    var
  1583. X    choice: char;
  1584. X
  1585. X    begin
  1586. X    repeat
  1587. X        writeln(output);
  1588. X        writeln(output);
  1589. X        writeln(output, '                           Menu');
  1590. X        writeln(output, '                           ----');
  1591. X        writeln(output);
  1592. X        writeln(output, '                 [a]                  answer questionare');
  1593. X        writeln(output, '                 [b]                  brouse questionare');
  1594. X        writeln(output, '                 [c]                  make a match');
  1595. X        writeln(output, '                 [d]                  delete your questionare');
  1596. X        writeln(output);
  1597. X        writeln(output, '                 [e]                  quit');
  1598. X
  1599. X        choice := getanswer(lastchoice);
  1600. X
  1601. X        case choice of
  1602. X        'a':
  1603. X            answer;
  1604. X        'b':
  1605. X            brouse;
  1606. X        'c':
  1607. X            match;
  1608. X        'd':
  1609. X            delete;
  1610. X        'e':
  1611. X            writeln(output)
  1612. X        end
  1613. X    until choice = lastchoice
  1614. X
  1615. X    end; { menu }
  1616. X
  1617. Xbegin
  1618. X    initialize;
  1619. X    if continue then begin
  1620. X    menu;
  1621. X    savedata
  1622. X    end;
  1623. X    bye
  1624. Xend. { date }
  1625. X
  1626. END_OF_date.v1.p
  1627. if test 14598 -ne `wc -c <date.v1.p`; then
  1628.     echo shar: \"date.v1.p\" unpacked with wrong size!
  1629. fi
  1630. # end of overwriting check
  1631. fi
  1632. if test -f date.v2.p -a "${1}" != "-c" ; then 
  1633.   echo shar: Will not over-write existing file \"date.v2.p\"
  1634. else
  1635. echo shar: Extracting \"date.v2.p\" \(15266 characters\)
  1636. sed "s/^X//" >date.v2.p <<'END_OF_date.v2.p'
  1637. Xprogram date(input, output, Questions, database, bbase);
  1638. X
  1639. X(*
  1640. X             Date-A-Base version 2.0
  1641. X                by
  1642. X                      Thomas M. Johnson
  1643. X
  1644. X                   john1233@csd4.milw.wisc.edu
  1645. X                 or
  1646. X                         tommyj@lakesys
  1647. X
  1648. X    file used:
  1649. X       .date/Questions - holds the questionaire
  1650. X       .date/database  - all the people registered with the Date-A-Base
  1651. X             and their information
  1652. X       .date/bbase     - data used by the brouse command.
  1653. X
  1654. X    version 2.0 must have getw.h in the same directory. This routine
  1655. X      allows Pascal to access the C getlogin() function.
  1656. X
  1657. X
  1658. X(c) 1987 Thomas M. Johnson *)
  1659. X
  1660. X
  1661. X
  1662. X
  1663. Xconst
  1664. X    NUMOFQUESTIONS = 49;
  1665. X    STRINGLENGTH = 20;
  1666. X    ONE = 1;
  1667. X    LOW = 'a';
  1668. X
  1669. Xtype
  1670. X    string = packed array [ONE..STRINGLENGTH] of char;
  1671. X    answerarray = packed array [ONE..NUMOFQUESTIONS] of char;
  1672. X    userp = ^ usertype;
  1673. X    usertype = 
  1674. X    record 
  1675. X        login: string;
  1676. X        sex: char;
  1677. X        timeson: integer;
  1678. X        answers: answerarray;
  1679. X        laston: integer;
  1680. X        next: userp
  1681. X    end;
  1682. X
  1683. Xvar
  1684. X    Questions: text;
  1685. X    database: file of usertype;
  1686. X    head: userp;
  1687. X    static: usertype;
  1688. X    bbase: text;
  1689. X    continue: boolean;
  1690. X
  1691. X#include "getw.h"
  1692. X
  1693. X    function cstrings(var string1: answerarray; string2: answerarray): real;
  1694. X
  1695. X    (* The function cstrings takes 2 strings and compares them.
  1696. X       cstrings then returns the percent identical the strings are.
  1697. X       The strings are compared letter for letter and must be in the
  1698. X       same place in the string.                               *)
  1699. X
  1700. X
  1701. X    var
  1702. X    counter: integer;
  1703. X    percent: integer;
  1704. X
  1705. X    begin
  1706. X    percent := 0;
  1707. X
  1708. X    for counter := ONE to NUMOFQUESTIONS do 
  1709. X        if string1[counter] = string2[counter] then 
  1710. X        percent := percent + 1;
  1711. X    cstrings := percent / NUMOFQUESTIONS * 100
  1712. X    end; { cstrings }
  1713. X
  1714. X    function yesNo: boolean;
  1715. X
  1716. X    const
  1717. X    yes = 'y';
  1718. X    no = 'n';
  1719. X
  1720. X    var
  1721. X    ch: char;
  1722. X
  1723. X    begin
  1724. X    repeat
  1725. X        write(output, ' (y/n) ');
  1726. X        readln(input, ch)
  1727. X    until (ch = yes) or (ch = no);
  1728. X    yesNo := ch = yes
  1729. X    end; { yesNo }
  1730. X
  1731. X
  1732. X
  1733. X
  1734. X    function getanswer(ubound: char): char;
  1735. X
  1736. X    (* The function getanswer reads in a character and checks to see
  1737. X       if it is in the range of lobound to ubound. If it isn't, then the
  1738. X       user is reprompted.                                          *)
  1739. X
  1740. X
  1741. X    var
  1742. X    tempchar: char;
  1743. X    charindex: char;
  1744. X
  1745. X    begin
  1746. X    repeat
  1747. X        writeln(output);
  1748. X
  1749. X        for charindex := LOW to ubound do 
  1750. X        write(output, charindex);
  1751. X
  1752. X        writeln(output);
  1753. X        write(output, 'Your choice: ');
  1754. X        readln(input, tempchar)
  1755. X    until (tempchar >= LOW) and (tempchar <= ubound);
  1756. X
  1757. X    writeln(output);
  1758. X    getanswer := tempchar
  1759. X    end; { getanswer }
  1760. X
  1761. X    procedure clearstring(var tempstring: string);
  1762. X
  1763. X    const
  1764. X
  1765. X    blank = ' ';
  1766. X    var
  1767. X    i: integer;
  1768. X
  1769. X    begin
  1770. X    for i := ONE to STRINGLENGTH do 
  1771. X        tempstring[i] := blank
  1772. X    end; { clearstring }
  1773. X
  1774. X
  1775. X
  1776. X    procedure readstring(var tempstring: string);
  1777. X
  1778. X    (* read a string from standard input. the string must have
  1779. X       a length of 2 or greater or it is invalid.   *)
  1780. X
  1781. X
  1782. X    const
  1783. X    init = 0;
  1784. X    inc = 1;
  1785. X
  1786. X    var
  1787. X    ch: char;
  1788. X    length: integer;
  1789. X
  1790. X    begin
  1791. X    repeat
  1792. X        clearstring(tempstring);
  1793. X        length := init;
  1794. X        while not eoln(input) do begin
  1795. X        read(input, ch);
  1796. X        length := length + inc;
  1797. X        tempstring[length] := ch
  1798. X        end;
  1799. X        readln(input)
  1800. X    until length > 1
  1801. X
  1802. X    end; { readstring }
  1803. X
  1804. X    procedure readint(var sum: integer);
  1805. X
  1806. X    (* read in a string from standard input and convert to an
  1807. X       integer.     *)
  1808. X
  1809. X
  1810. X    const
  1811. X    init = 0;
  1812. X    inc = 1;
  1813. X    base = 10;
  1814. X    intlow = '0';
  1815. X    inthigh = '9';
  1816. X
  1817. X    var
  1818. X    i: integer;
  1819. X    done: boolean;
  1820. X    hold: string;
  1821. X
  1822. X    begin
  1823. X    i := inc;
  1824. X    done := false;
  1825. X    sum := init;
  1826. X    readstring(hold);
  1827. X    while (i <= STRINGLENGTH) and not done do 
  1828. X        if (hold[i] < intlow) or (hold[i] > inthigh) then 
  1829. X        done := true
  1830. X        else begin
  1831. X        sum := sum * base + (ord(hold[i]) - ord(intlow));
  1832. X        if sum > maxint then 
  1833. X            done := true
  1834. X        else 
  1835. X            i := i + inc
  1836. X        end
  1837. X    end; { readint }
  1838. X
  1839. X
  1840. X
  1841. X    procedure printques(var quests: answerarray);
  1842. X
  1843. X    (* prints the questions from the file Questions.
  1844. X       the question file is set up like:
  1845. X    
  1846. X       The question
  1847. X       the answers
  1848. X               .
  1849. X               .
  1850. X               .
  1851. X               .
  1852. X       ^G (up limit)
  1853. X    
  1854. X       then ^G is just a marker to signify where the answers end.
  1855. X       low limit is usually and 'a'
  1856. X       up limit the the last answer
  1857. X    
  1858. X       *)
  1859. X
  1860. X    var
  1861. X    ch: char;
  1862. X    uplimit: char;
  1863. X    chset: set of char;
  1864. X    i: integer;
  1865. X
  1866. X    begin
  1867. X    reset(Questions,'.date/Questions');
  1868. X    i := 1;
  1869. X    chset := ['A'..'Z', 'a'..'z', '0'..'9', '?', '.', ' ', '-', '/'];
  1870. X    ch := ' ';
  1871. X    while not eof(Questions) do begin
  1872. X        while not eoln(Questions) do begin
  1873. X        read(Questions, ch);
  1874. X        if ch in chset then 
  1875. X            write(output, ch)
  1876. X        else begin
  1877. X            readln(Questions, uplimit);
  1878. X            quests[i] := getanswer(uplimit);
  1879. X            i := i + 1
  1880. X        end
  1881. X        end;
  1882. X        readln(Questions);
  1883. X        writeln(output)
  1884. X    end
  1885. X    end; { printques }
  1886. X
  1887. X
  1888. X    function test(string1: string; string2: string): boolean;
  1889. X
  1890. X    (* I was having a lot of trouble converting the Search function from
  1891. X       version 1 to this version because the strings were coming out
  1892. X       of the getw.h external procedure 1 character longer than all the
  1893. X       other strings. So the comparison was always false. This function
  1894. X       takes the place of that comparison.
  1895. X       *)
  1896. X
  1897. X    var
  1898. X    same: boolean;
  1899. X    i: integer;
  1900. X    chset: set of char;
  1901. X
  1902. X
  1903. X    begin
  1904. X    i := ONE;
  1905. X    same := true;
  1906. X    chset := ['a'..'z', 'A'..'Z', '0'..'9'];
  1907. X
  1908. X    while (string1[i] in chset) and (string2[i] in chset) and same do begin
  1909. X        same := string1[i] = string2[i];
  1910. X        i := i + ONE
  1911. X    end;
  1912. X
  1913. X    test := same;
  1914. X    if string1[i + ONE] <> string2[i + ONE] then 
  1915. X        test := false
  1916. X    end; { test }
  1917. X
  1918. X
  1919. X
  1920. X
  1921. X    function Search(lookfor: string; var hisrec: usertype): boolean;
  1922. X
  1923. X    (* scan the linked list to find a match between the string lookfor 
  1924. X       and the .login field. If there is a match, a true is returned with
  1925. X       the record of that person. Otherwise a false is returned *)
  1926. X
  1927. X
  1928. X    var
  1929. X    found: boolean;
  1930. X    temptr: userp;
  1931. X
  1932. X    begin
  1933. X    found := false;
  1934. X    temptr := head;
  1935. X
  1936. X    while (temptr <> nil) and not found do 
  1937. X        if test(temptr^.login, lookfor) then begin
  1938. X        hisrec := temptr^;
  1939. X        found := true
  1940. X        end else 
  1941. X        temptr := temptr^.next;
  1942. X
  1943. X    Search := found
  1944. X    end; { Search }
  1945. X
  1946. X
  1947. X    procedure newUser;
  1948. X
  1949. X    (* if the person in not in the linked list, add him *)
  1950. X
  1951. X
  1952. X    const
  1953. X    male = 'm';
  1954. X    female = 'f';
  1955. X    inc = 1;
  1956. X
  1957. X    var
  1958. X    ch: char;
  1959. X    node: userp;
  1960. X
  1961. X
  1962. X
  1963. X    begin
  1964. X    writeln(output, 'To use the Date-A-Base you will have to answer a');
  1965. X    writeln(output, 'personal questionaire. Your answers to all the');
  1966. X    writeln(output, 'questions will be available for anyone registered');
  1967. X    writeln(output, 'in the Date-A-Base to look at.');
  1968. X    writeln(output);
  1969. X    writeln(output, 'Do you want to continue? ');
  1970. X    continue := yesNo;
  1971. X
  1972. X    if continue then begin
  1973. X        repeat
  1974. X        writeln(output);
  1975. X        writeln(output, 'What sex are you? m or f');
  1976. X        readln(input, ch)
  1977. X        until (ch = male) or (ch = female);
  1978. X        static.sex := ch;
  1979. X        with static do begin
  1980. X        timeson := inc;
  1981. X        laston := wallclock
  1982. X        end;
  1983. X        printques(static.answers);
  1984. X        writeln(output);
  1985. X        new(node);
  1986. X        node^ := static;
  1987. X        node^.next := head;
  1988. X        head := node
  1989. X    end
  1990. X    end; { newUser }
  1991. X
  1992. X
  1993. X
  1994. X
  1995. X    procedure oldUser;
  1996. X
  1997. X    (* the person is already registered. Just get his data. *)
  1998. X
  1999. X
  2000. X    const
  2001. X
  2002. X
  2003. X    inc = 1;
  2004. X    var
  2005. X    temptr: userp;
  2006. X    found: boolean;
  2007. X
  2008. X
  2009. X    begin
  2010. X    writeln(output);
  2011. X    with static do begin
  2012. X        timeson := timeson + inc;
  2013. X        laston := wallclock
  2014. X    end;
  2015. X    temptr := head;
  2016. X    found := false;
  2017. X    while (temptr <> nil) and not found do 
  2018. X        if temptr^.login = static.login then begin
  2019. X        static.next := temptr^.next;
  2020. X        temptr^ := static;
  2021. X        found := true
  2022. X        end else 
  2023. X        temptr := temptr^.next
  2024. X
  2025. X    end; { oldUser }
  2026. X
  2027. X    procedure initialize;
  2028. X
  2029. X    (* This procedure reads in the current file with all registered
  2030. X       users into a linked list. *)
  2031. X
  2032. X
  2033. X    const
  2034. X
  2035. X    copymax = 15;
  2036. X    var
  2037. X    node: userp;
  2038. X    name: string;
  2039. X    i: integer;
  2040. X
  2041. X    begin
  2042. X    head := nil;
  2043. X    reset(database,'.date/database');
  2044. X    while not eof(database) do begin
  2045. X        new(node);
  2046. X        read(database, node^);
  2047. X        node^.next := head;
  2048. X        head := node
  2049. X    end;
  2050. X    writeln(output);
  2051. X    writeln(output);
  2052. X    writeln(output, '               The');
  2053. X    writeln(output, '           Date-A-Base');
  2054. X    writeln(output);
  2055. X    writeln(output);
  2056. X    writeln(output, '  The computerized dating service.');
  2057. X    writeln(output);
  2058. X    writeln(output);
  2059. X    writeln(output);
  2060. X    continue := true;
  2061. X    clearstring(name);
  2062. X    getwh(name);
  2063. X    for i := ONE to copymax do 
  2064. X        static.login[i] := name[i];
  2065. X    if not Search(name, static) then 
  2066. X        newUser
  2067. X    else 
  2068. X        oldUser
  2069. X
  2070. X
  2071. X    end; { initialize }
  2072. X
  2073. X    procedure savedata;
  2074. X
  2075. X    (* save the linked list in the file database *)
  2076. X
  2077. X
  2078. X    var
  2079. X    pointer: userp;
  2080. X
  2081. X
  2082. X    begin
  2083. X    rewrite(database,'.date/database');
  2084. X    pointer := head;
  2085. X    if pointer <> nil then 
  2086. X        while pointer^.next <> nil do begin
  2087. X        write(database, pointer^);
  2088. X        pointer := pointer^.next
  2089. X        end;
  2090. X    write(database, pointer^)
  2091. X
  2092. X    end; { savedata }
  2093. X
  2094. X    procedure answer;
  2095. X
  2096. X    (* answer the questionaire again *)
  2097. X
  2098. X
  2099. X    var
  2100. X    check: boolean;
  2101. X    temptr: userp;
  2102. X    found: boolean;
  2103. X
  2104. X    begin
  2105. X    writeln(output);
  2106. X    writeln(output, 'Are you sure you want to answer all the');
  2107. X    writeln(output, 'questions again?');
  2108. X    check := yesNo;
  2109. X    if check then 
  2110. X        printques(static.answers);
  2111. X    temptr := head;
  2112. X    found := false;
  2113. X    while (temptr <> nil) and not found do 
  2114. X        if temptr^.login = static.login then begin
  2115. X        static.next := temptr^.next;
  2116. X        temptr^ := static;
  2117. X        found := true
  2118. X        end else 
  2119. X        temptr := temptr^.next
  2120. X
  2121. X    end; { answer }
  2122. X
  2123. X    procedure brouse;
  2124. X
  2125. X    (* give a quick scan of someone else's questionaire. the data for
  2126. X       the brouse is in bbase. Data looks like:
  2127. X    
  2128. X              the topic
  2129. X              the maximum answer
  2130. X              answer
  2131. X                .
  2132. X                .
  2133. X                .
  2134. X    
  2135. X                *)
  2136. X
  2137. X
  2138. X    const
  2139. X    low = 'a';
  2140. X    clicks = 86400;                    (* number of seconds in a day *)
  2141. X    field = 3;
  2142. X    zero = 0;
  2143. X    marker = 15;
  2144. X
  2145. X    var
  2146. X    who: string;
  2147. X    index: char;
  2148. X    ch: char;
  2149. X    max: char;
  2150. X    i: integer;
  2151. X    j: integer;
  2152. X    time: integer;
  2153. X    rec: usertype;
  2154. X
  2155. X    begin
  2156. X    writeln(output, 'Whose questionare do you want to brouse?');
  2157. X    write(output, '? ');
  2158. X    readstring(who);
  2159. X
  2160. X
  2161. X
  2162. X    if Search(who, rec) then begin
  2163. X
  2164. X        i := ONE;
  2165. X        j := ONE;
  2166. X        reset(bbase,'.date/bbase');
  2167. X        writeln(output);
  2168. X        write(output, 'Name: ');
  2169. X        writeln(output, rec.login);
  2170. X        write(output, 'Used the Date-A-Base ');
  2171. X        write(output, rec.timeson: field);
  2172. X        if rec.timeson = ONE then 
  2173. X        writeln(output, ' time. ')
  2174. X        else 
  2175. X        writeln(output, ' times. ');
  2176. X
  2177. X        write(output, 'Last used the Date-A-Base: ');
  2178. X        time := wallclock - rec.laston;
  2179. X        time := time div clicks;
  2180. X        if time = zero then 
  2181. X        writeln(output, 'today.');
  2182. X        if time = ONE then 
  2183. X        writeln(output, 'yesterday.');
  2184. X        if time > ONE then begin
  2185. X        write(output, time: field);
  2186. X        writeln(output, ' days ago.')
  2187. X        end;
  2188. X
  2189. X        writeln(output);
  2190. X        while not eof(bbase) do begin
  2191. X        while not eoln(bbase) do begin
  2192. X            read(bbase, ch);
  2193. X            write(output, ch)
  2194. X        end;
  2195. X        readln(bbase);
  2196. X        readln(bbase, max);
  2197. X        for index := low to max do begin
  2198. X            if index = rec.answers[i] then begin
  2199. X            while not eoln(bbase) do begin
  2200. X                read(bbase, ch);
  2201. X                write(output, ch)
  2202. X            end;
  2203. X            writeln(output);
  2204. X            readln(bbase)
  2205. X            end else 
  2206. X            readln(bbase)
  2207. X        end;
  2208. X        if j = marker then begin
  2209. X            repeat
  2210. X            writeln(output);
  2211. X            writeln(output, 'Continue? ')
  2212. X            until yesNo;
  2213. X            j := zero;
  2214. X            writeln(output)
  2215. X        end;
  2216. X        j := j + ONE;
  2217. X        i := i + ONE
  2218. X        end                    (* while not eof *)
  2219. X    end else 
  2220. X        writeln(output, 'Sorry that person is not registered!');
  2221. X
  2222. X    repeat
  2223. X        writeln(output);
  2224. X        writeln(output, 'Return to the menu? ')
  2225. X    until yesNo
  2226. X    end; { brouse }
  2227. X
  2228. X    procedure delete;
  2229. X
  2230. X    (* delete a person from the linked list *)
  2231. X
  2232. X    var
  2233. X    found: boolean;
  2234. X    pointer: userp;
  2235. X
  2236. X    begin
  2237. X    found := false;
  2238. X    writeln(output, 'Are you sure you want to delete yourself?');
  2239. X    if yesNo then begin
  2240. X        pointer := head;
  2241. X        if pointer^.login = static.login then begin
  2242. X        head := pointer^.next;
  2243. X        dispose(pointer)
  2244. X        end else 
  2245. X        while not found do 
  2246. X            while pointer^.next <> nil do 
  2247. X            if pointer^.next^.login = static.login then begin
  2248. X                pointer^.next := pointer^.next^.next;
  2249. X                dispose(pointer^.next);
  2250. X                found := true
  2251. X            end else 
  2252. X                pointer := pointer^.next
  2253. X    end
  2254. X    end; { delete }
  2255. X
  2256. X
  2257. X
  2258. X
  2259. X
  2260. X    procedure match;
  2261. X
  2262. X    (* find a match between 2 people. scans the whole linked list
  2263. X       and reports all matches greater than the amount entered. *)
  2264. X
  2265. X
  2266. X    const
  2267. X    loginfield = 47;
  2268. X    perfield = 5;
  2269. X    dplaces = 0;
  2270. X    namefield = 33;
  2271. X    low = 9;
  2272. X    high = 100;
  2273. X
  2274. X
  2275. X    var
  2276. X    pointer: userp;
  2277. X    percent: integer;
  2278. X    per: real;
  2279. X    found: boolean;
  2280. X
  2281. X
  2282. X    begin
  2283. X    pointer := head;
  2284. X    writeln(output);
  2285. X    writeln(output, 'What is the lowest percent match that');
  2286. X    writeln(output, 'you want to see? ');
  2287. X    repeat
  2288. X        write(output, ' (10 - 99) ');
  2289. X
  2290. X        readint(percent)
  2291. X    until (percent > low) and (percent < high);
  2292. X
  2293. X
  2294. X    writeln(output);
  2295. X    write(output, '%': perfield);
  2296. X    writeln(output, 'name': namefield);
  2297. X    writeln(output, '----------------------------------------------------');
  2298. X
  2299. X    found := false;
  2300. X    if pointer <> nil then 
  2301. X        while pointer <> nil do begin
  2302. X        per := cstrings(static.answers, pointer^.answers);
  2303. X        if (per >= percent) and (static.sex <> pointer^.sex) then begin
  2304. X            found := true;
  2305. X            writeln(output);
  2306. X            write(output, per: perfield: dplaces);
  2307. X            write(output, '%');
  2308. X            writeln(output, pointer^.login: loginfield)
  2309. X        end;
  2310. X        pointer := pointer^.next
  2311. X        end;
  2312. X    if not found then begin
  2313. X        writeln(output);
  2314. X        writeln(output, 'Sorry, no matches found today. Try again later.')
  2315. X    end;
  2316. X    repeat
  2317. X        writeln(output);
  2318. X        writeln(output);
  2319. X        writeln(output, 'Are you ready to continue?')
  2320. X    until yesNo
  2321. X
  2322. X    end; { match }
  2323. X
  2324. X    procedure bye;
  2325. X
  2326. X    begin
  2327. X    writeln(output);
  2328. X    writeln(output, 'Thank you for using the Date-A-Base');
  2329. X    writeln(output, 'Hope to hear from you again soon.');
  2330. X    writeln(output);
  2331. X    writeln(output);
  2332. X    writeln(output);
  2333. X    writeln(output);
  2334. X    writeln(output);
  2335. X    writeln(output,'(c) 1987 Thomas M. Johnson');
  2336. X    writeln(output)
  2337. X    end; { bye }
  2338. X
  2339. X
  2340. X    procedure menu;
  2341. X
  2342. X    (* The procedure menu is the programs main menu. It prints the
  2343. X       commands and executes the proper subroutine based on the users
  2344. X       choice.                                                  *)
  2345. X
  2346. X
  2347. X    const
  2348. X
  2349. X    lastchoice = 'e';
  2350. X    var
  2351. X    choice: char;
  2352. X
  2353. X    begin
  2354. X    repeat
  2355. X        writeln(output);
  2356. X        writeln(output);
  2357. X        writeln(output, '                           Menu');
  2358. X        writeln(output, '                           ----');
  2359. X        writeln(output);
  2360. X        writeln(output, '                 [a]                  answer questionare');
  2361. X        writeln(output, '                 [b]                  brouse questionare');
  2362. X        writeln(output, '                 [c]                  make a match');
  2363. X        writeln(output, '                 [d]                  delete your questionare');
  2364. X        writeln(output);
  2365. X        writeln(output, '                 [e]                  quit');
  2366. X
  2367. X        choice := getanswer(lastchoice);
  2368. X
  2369. X        case choice of
  2370. X        'a':
  2371. X            answer;
  2372. X        'b':
  2373. X            brouse;
  2374. X        'c':
  2375. X            match;
  2376. X        'd':
  2377. X            delete;
  2378. X        'e':
  2379. X            writeln(output)
  2380. X        end
  2381. X    until choice = lastchoice
  2382. X
  2383. X    end; { menu }
  2384. X
  2385. Xbegin
  2386. X    initialize;
  2387. X    if continue then begin
  2388. X    menu;
  2389. X    savedata
  2390. X    end;
  2391. X    bye
  2392. Xend. { date }
  2393. X
  2394. END_OF_date.v2.p
  2395. if test 15266 -ne `wc -c <date.v2.p`; then
  2396.     echo shar: \"date.v2.p\" unpacked with wrong size!
  2397. fi
  2398. # end of overwriting check
  2399. fi
  2400. if test -f getw.c -a "${1}" != "-c" ; then 
  2401.   echo shar: Will not over-write existing file \"getw.c\"
  2402. else
  2403. echo shar: Extracting \"getw.c\" \(83 characters\)
  2404. sed "s/^X//" >getw.c <<'END_OF_getw.c'
  2405. Xextern getwh();
  2406. X
  2407. Xchar *
  2408. Xgetwh() {
  2409. Xchar  *getlogin();
  2410. X   return (getlogin());
  2411. X   }
  2412. X
  2413. END_OF_getw.c
  2414. if test 83 -ne `wc -c <getw.c`; then
  2415.     echo shar: \"getw.c\" unpacked with wrong size!
  2416. fi
  2417. # end of overwriting check
  2418. fi
  2419. if test -f getw.h -a "${1}" != "-c" ; then 
  2420.   echo shar: Will not over-write existing file \"getw.h\"
  2421. else
  2422. echo shar: Extracting \"getw.h\" \(42 characters\)
  2423. sed "s/^X//" >getw.h <<'END_OF_getw.h'
  2424. Xprocedure getwh(var w: string); external;
  2425. END_OF_getw.h
  2426. if test 42 -ne `wc -c <getw.h`; then
  2427.     echo shar: \"getw.h\" unpacked with wrong size!
  2428. fi
  2429. # end of overwriting check
  2430. fi
  2431. echo shar: End of shell archive.
  2432. exit 0
  2433.